package cn.com.scitc.licenseplateback.model;

import javax.persistence.*;
import java.util.Objects;

@Entity
@Table(name = "VehicleAccessInformation", schema = "CubeLibrary", catalog = "")
public class VehicleAccessInformationEntity {
    private int autoNumber;
    private String name;
    private String idNumber;
    private String licensePlateNumber;
    private String pickUpCode;
    private int membershipLevel;
    private String membershipDiscount;
    private String warehousingTime;
    private String outgoingTime;

    @Id
    @Column(name = "AutoNumber", nullable = false)
    public int getAutoNumber() {
        return autoNumber;
    }

    public void setAutoNumber(int autoNumber) {
        this.autoNumber = autoNumber;
    }

    @Basic
    @Column(name = "Name", nullable = false, length = 32)
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Basic
    @Column(name = "IDNumber", nullable = false, length = 18)
    public String getIdNumber() {
        return idNumber;
    }

    public void setIdNumber(String idNumber) {
        this.idNumber = idNumber;
    }

    @Basic
    @Column(name = "LicensePlateNumber", nullable = false, length = 32)
    public String getLicensePlateNumber() {
        return licensePlateNumber;
    }

    public void setLicensePlateNumber(String licensePlateNumber) {
        this.licensePlateNumber = licensePlateNumber;
    }

    @Basic
    @Column(name = "PickUpCode", nullable = false, length = 32)
    public String getPickUpCode() {
        return pickUpCode;
    }

    public void setPickUpCode(String pickUpCode) {
        this.pickUpCode = pickUpCode;
    }

    @Basic
    @Column(name = "MembershipLevel", nullable = false)
    public int getMembershipLevel() {
        return membershipLevel;
    }

    public void setMembershipLevel(int membershipLevel) {
        this.membershipLevel = membershipLevel;
    }

    @Basic
    @Column(name = "MembershipDiscount", nullable = false, precision = 2)
    public String getMembershipDiscount() {
        return membershipDiscount;
    }

    public void setMembershipDiscount(String membershipDiscount) {
        this.membershipDiscount = membershipDiscount;
    }

    @Basic
    @Column(name = "WarehousingTime", nullable = false)
    public String getWarehousingTime() {
        return warehousingTime;
    }

    public void setWarehousingTime(String warehousingTime) {
        this.warehousingTime = warehousingTime;
    }

    @Basic
    @Column(name = "OutgoingTime", nullable = true)
    public String getOutgoingTime() {
        return outgoingTime;
    }

    public void setOutgoingTime(String outgoingTime) {
        this.outgoingTime = outgoingTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        VehicleAccessInformationEntity that = (VehicleAccessInformationEntity) o;
        return autoNumber == that.autoNumber &&
                membershipLevel == that.membershipLevel &&
                Objects.equals(name, that.name) &&
                Objects.equals(idNumber, that.idNumber) &&
                Objects.equals(licensePlateNumber, that.licensePlateNumber) &&
                Objects.equals(pickUpCode, that.pickUpCode) &&
                Objects.equals(membershipDiscount, that.membershipDiscount) &&
                Objects.equals(warehousingTime, that.warehousingTime) &&
                Objects.equals(outgoingTime, that.outgoingTime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(autoNumber, name, idNumber, licensePlateNumber, pickUpCode, membershipLevel, membershipDiscount, warehousingTime, outgoingTime);
    }
}
